/**
 * There exists another easier method based on the observation.
 * Any none-one number could be represented by the combination of prime numbers.
 * 
 */

/**
 * @author antonio081014
 * @since Dec 23, 2011, 6:02:46 PM
 */

public class MagicStonesStore {
	public String ableToDivide(int n) {
		for (int i = 1; i <= n; i++) {
			if (isPrime(i) && isPrime(2 * n - i))
				return "YES";
		}
		return "NO";
	}

	public boolean isPrime(int n) {
		if (n <= 1)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;
		for (int i = 3; i * i <= n; i++)
			if (n % i == 0)
				return false;
		return true;
	}

	// <%:testing-code%>
}
// Powered by [KawigiEdit] 2.0!
